<div class="modal-header">
  <h3 class="modal-title"><i class="fa fa-refresh"></i> {{modal.dataObj.title}}</h3>
</div>
<div class="modal-body">
  <div ng-if="modal.updaterService.status === 'updateReady'">
    <span ng-bind-html="modal.dataObj.description"></span>
  </div>

  <div ng-if="modal.updaterService.status === 'updateProgress'">
    <h4>{{modal.updaterService.updateProgress.status}}</h4>
    <uib-progressbar
        class="progress-striped active"
        value="modal.updaterService.updateProgress.progress"
        type="default">{{modal.updaterService.updateProgress.progress}}%
    </uib-progressbar>
    <span ng-if="modal.updaterService.updateProgress.downloadSpeed">
      <span  translate="UPDATER.DOWNLOAD_SPEED"></span>: {{modal.updaterService.updateProgress.downloadSpeed}} |
    </span>
    <span ng-if="modal.updaterService.updateProgress.eta">
      <span translate="UPDATER.TIME_REMAINING"></span>: {{modal.updaterService.updateProgress.eta}}
    </span>
  </div>

  <div ng-if="modal.updaterService.status === 'updateDone'">
    <h3>{{modal.updaterService.updateDone.message}}</h3>
  </div>
</div>

<div class="modal-footer">
  <div ng-if="modal.updaterService.status === 'updateReady' || modal.updaterService.status === 'updateWaitMsg'" >
    <button
        ng-if="modal.updaterService.updateReady.updateavailable"
        class="btn btn-warning"
        ng-click="modal.cancel()">
    <span translate="COMMON.CANCEL"></span>
    </button>

    <button
        ng-if="modal.updaterService.updateReady.updateavailable"
        class="btn btn-primary"
        ng-click="modal.update('now')">
      <span translate="UPDATER.UPDATE_NOW"></span>
    </button>

    <button
        ng-if="!modal.updaterService.updateReady.updateavailable"
        class="btn btn-primary"
        ng-click="modal.cancel()">
      <span translate="COMMON.OK"></span>
    </button>
  </div>

  <div ng-if="modal.updaterService.status === 'updateDone'" >
    <button
        ng-if="modal.updaterService.updateDone.status === 'success'"
        class="btn btn-primary" ng-click="modal.reboot()">
      <span translate="COMMON.RESTART_SYSTEM"></span>
    </button>

    <button
        ng-if="modal.updaterService.updateDone.status === 'error'"
        class="btn btn-primary" ng-click="modal.cancel()">
      <span translate="COMMON.OK"></span>
    </button>
  </div>
</div>
